package love.lemoncat.entity;

import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;


@Data
public class LogView implements Serializable {
    private static DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
    // 时间
    private String dateTime;
    // 命令发布者
    private String commander;
    // 警告级别
    private String warningLevel;
    // 内容
    private String content;

    public LogView(String commander, String warningLevel, String content) {
        LocalDateTime now = LocalDateTime.now();
        this.dateTime = now.format(dtf);
        this.commander = commander;
        this.warningLevel = warningLevel;
        this.content = content;
    }
}
